package com.lzj;
// 测试并验证
public class FruitShopping {
    public static void main(String[] args) {
        // 创建水果对象
        Fruit apple = new Fruit("Apple", 8);
        Fruit strawberry = new Fruit("Strawberry", 13);
        Fruit mango = new Fruit("Mango", 20);

        // 创建购物车对象
        ShoppingCart cartA = new ShoppingCart(5, 3, 0); // 顾客A购买了5斤苹果和3斤草莓
        ShoppingCart cartB = new ShoppingCart(5, 3, 2); // 顾客B购买了5斤苹果、3斤草莓和2斤芒果
        ShoppingCart cartC = new ShoppingCart(5, 3, 2); // 顾客C购买了5斤苹果、2斤草莓和2斤芒果
        ShoppingCart cartD = new ShoppingCart(5, 3, 2); // 顾客D购买了5斤苹果、3斤草莓和2斤芒果

        // 计算并验证顾客A的总价
        double totalA = cartA.calculateTotalForCustomerA(apple, strawberry);
        System.out.println("顾客 A 的总价: " + totalA); // 应输出：Customer A Total: 79.0

        // 计算并验证顾客B的总价
        double totalB = cartB.calculateTotalForCustomerB(apple, strawberry, mango);
        System.out.println("顾客 B 的总价: " + totalB); // 应输出：Customer B Total: 119.0

        // 计算并验证顾客C的总价
        double totalC = cartC.calculateTotalForCustomerC(apple, strawberry, mango);
        System.out.println("顾客 C 的总价: " + totalC); // 应输出：Customer C Total: 111.2

        // 计算并验证顾客D的总价
        double totalD = cartD.calculateTotalForCustomerD(apple, strawberry, mango);
        System.out.println("顾客 D 的总价: " + totalD); // 应输出：Customer D Total: 101.2

    }
}
